<?php
defined('IN_PHPCMS') or exit('Access Denied');
require_once 'cache.func.php';
if(!is_object($model))
{
	require_once PHPCMS_ROOT.'yp/admin/include/model.class.php';
	$model = new model();
}
//检测字段是否存在 ，不存在则增加
if(!$db->field_exists(DB_PRE.'category', 'letter'))
{
	$db->query("ALTER TABLE `".DB_PRE."category` ADD `letter` VARCHAR( 1 ) NOT NULL ");
}
if(!$db->field_exists(DB_PRE.'category', 'citems'))
{
	$db->query("ALTER TABLE `".DB_PRE."category` ADD `citems` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0' ");
}
if(!$db->field_exists(DB_PRE.'category', 'pitems'))
{
	$db->query("ALTER TABLE `".DB_PRE."category` ADD `pitems` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0' ");
}
//拷贝css 和 图片 到安装的目录
dir_copy(PHPCMS_ROOT.'yp/install/skins/', PHPCMS_ROOT.'templates/'.TPL_NAME.'/skins/'.TPL_CSS.'/');

$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(40, '我的简历', '', 'yp/apply.php', '', '_self', '', '', '', '', 0, 0, 0, 0, '')");

$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(5, '企业黄页', '', '', '', '_self', '', '', '', '', 1, 0, 0, 0, 'yp');");
$parentid = $db->insert_id();
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '快捷面板', '', '?mod=yp&file=panel', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '审核产品', '', '?mod=yp&file=product&action=manage&job=check', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '管理产品', '', '?mod=yp&file=product&action=manage', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '审核商机', '', '?mod=yp&file=buy&action=manage&job=check', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '管理商机', '', '?mod=yp&file=buy&action=manage', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '审核招聘', '', '?mod=yp&file=job&action=manage&job=check', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '管理招聘', '', '?mod=yp&file=job&action=manage', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '人才库', '', '?mod=yp&file=talent', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '审核公司新闻', '', '?mod=yp&file=news&action=manage&job=check', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '管理公司新闻', '', '?mod=yp&file=news&action=manage', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '管理公司', '', '?mod=yp&file=company', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '管理证书', '', '?mod=yp&file=certificate', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '远程公告', '', '?mod=yp&file=announce', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '收藏统计', '', '?mod=yp&file=collect', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '公司模板管理', '', '?mod=yp&file=template', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '招聘岗位管理', '', '?mod=yp&file=station', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '分类管理', '', '?mod=yp&file=category', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '权限设置', '', '?mod=yp&file=priv', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '黄页模型管理', '', '?mod=yp&file=model', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '模块配置', '', '?mod=yp&file=setting', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
//添加模板风格组菜单
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(7, '企业黄页', '', '', '', '_self', '', '', '', '', 1, 0, 0, 0, 'yp');");
$parentid = $db->insert_id();
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '管理模板', '', '?mod=phpcms&file=template&action=manage&module=yp', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '添加模板', '', '?mod=phpcms&file=template&action=add&module=yp', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '添加新闻标签', '', '?mod=yp&file=tag&action=add&type=news', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '管理新闻标签', '', '?mod=yp&file=tag&action=manage&type=news', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '添加产品标签', '', '?mod=yp&file=tag&action=add&type=product', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '管理产品标签', '', '?mod=yp&file=tag&action=manage&type=product', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '添加企业招聘标签', '', '?mod=yp&file=tag&action=add&type=job', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(".$parentid.", '管理企业招聘标签', '', '?mod=yp&file=tag&action=manage&type=job', '', 'right', '', '', '', '', 0, 0, 0, 0, 'yp');");

$model->cache();

$db->query("INSERT INTO `".DB_PRE."model` (`name`, `description`, `tablename`, `itemname`, `itemunit`, `workflowid`, `template_category`, `template_list`, `template_show`, `template_print`, `ishtml`, `category_urlruleid`, `show_urlruleid`, `enablesearch`, `ischeck`, `isrelated`, `disabled`, `modeltype`) VALUES('企业会员', '企业黄页商家', 'company', '', '', 0, '', '', '', '', 0, 0, 0, 1, 1, 1, 0, 2);");
$model_companyid = $parentid = $db->insert_id();
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES
(".$parentid.", 'companyname', '企业名称', '', '', 0, 100, '', '', 'text', 'array (\n  ''size'' => ''35'',\n  ''defaultvalue'' => '''',\n  ''ispassword'' => ''0'',\n)', '', '-99', '-99', 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0),
(".$parentid.", 'catids', '企业库', '', 'size=\"8\" style=\"width:195px;\"', 0, 200, '', '', 'catids', 'array (\n  ''defaultvalue'' => '''',\n)', 'onchange=\"select_catids();\"', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0),
(".$parentid.", 'pattern', '经营模式', '', '', 0, 255, '', '', 'box', 'array (\n  ''options'' => ''生产型|生产型\r\n贸易型|贸易型\r\n服务型|服务型\r\n政府或其他机构|政府或其他机构'',\n  ''boxtype'' => ''checkbox'',\n  ''fieldtype'' => ''CHAR'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0),
(".$parentid.", 'products', '主营产品或服务', '', '', 0, 0, '', '', 'textarea', 'array (\n  ''rows'' => ''4'',\n  ''cols'' => ''80'',\n  ''defaultvalue'' => '''',\n  ''enablehtml'' => ''0'',\n  ''enablekeylink'' => ''0'',\n)', '', '-99', '-99', 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0),
(".$parentid.", 'genre', '公司类型', '', '', 0, 30, '', '', 'box', 'array (\n  ''options'' => ''企业单位|企业单位\r\n个体经营|个体经营\r\n事业单位或社会团体|事业单位或社会团体\r\n未经工商注册，个人|未经工商注册，个人'',\n  ''boxtype'' => ''radio'',\n  ''fieldtype'' => ''VARCHAR'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => ''未经工商注册，个人'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 2, 0),
(".$parentid.", 'areaname', '公司所在地', '', '', 0, 10, '', '', 'box', 'array (\n  ''options'' => ''北京|北京\r\n上海|上海\r\n杭州|杭州\r\n广州|广州\r\n深圳|深圳\r\n南京|南京\r\n武汉|武汉\r\n天津|天津\r\n成都|成都\r\n哈尔滨|哈尔滨\r\n重庆|重庆\r\n宁波|宁波\r\n无锡|无锡\r\n济南|济南\r\n苏州|苏州\r\n温州|温州\r\n青岛|青岛\r\n沈阳|沈阳\r\n福州|福州\r\n西安|西安\r\n长沙|长沙\r\n合肥|合肥\r\n南宁|南宁\r\n南昌|南昌\r\n郑州|郑州\r\n厦门|厦门\r\n大连|大连\r\n常州|常州\r\n石家庄|石家庄\r\n东莞|东莞\r\n安徽|安徽\r\n福建|福建\r\n甘肃|甘肃\r\n广东|广东\r\n广西|广西\r\n贵州|贵州\r\n海南|海南\r\n河北|河北\r\n黑龙江|黑龙江\r\n河南|河南\r\n湖北|湖北\r\n湖南|湖南\r\n江苏|江苏\r\n江西|江西\r\n吉林|吉林\r\n辽宁|辽宁\r\n内蒙古|内蒙古\r\n宁夏|宁夏\r\n青海|青海\r\n山东|山东\r\n山西|山西\r\n陕西|陕西\r\n四川|四川\r\n新疆|新疆\r\n西藏|西藏\r\n云南|云南\r\n浙江|浙江\r\n澳门|澳门\r\n台湾|台湾\r\n香港|香港\r\n惠州|惠州\r\n佛山|佛山\r\n珠海|珠海\r\n中山|中山\r\n海外|海外\r\n其它|其它'',\n  ''boxtype'' => ''select'',\n  ''fieldtype'' => ''CHAR'',\n  ''cols'' => '''',\n  ''width'' => '''',\n  ''size'' => '''',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 3, 0),
(".$parentid.", 'address', '经营地址', '', '', 0, 100, '', '', 'text', 'array (\n  ''size'' => ''50'',\n  ''defaultvalue'' => '''',\n  ''ispassword'' => ''0'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 4, 0)");
$model->cache_field($parentid);

$db->query("INSERT INTO `".DB_PRE."model` (`name`, `description`, `tablename`, `itemname`, `itemunit`, `workflowid`, `template_category`, `template_list`, `template_show`, `template_print`, `ishtml`, `category_urlruleid`, `show_urlruleid`, `enablesearch`, `ischeck`, `isrelated`, `disabled`, `modeltype`) VALUES('新闻', '公司新闻', 'news', '新闻', '篇', 1, '', '', '', '', 1, 1, 7, 1, 1, 1, 0, 9)");
$parentid = $db->insert_id();
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES
(".$parentid.", 'id', 'ID', '', '', 0, 0, '', '', 'number', '', '', '', '', 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0),
(".$parentid.", 'title', '标题', '', 'inputtitle', 0, 255, '', '', 'text', 'array (\n  ''size'' => ''80'',\n  ''defaultvalue'' => '''',\n  ''ispassword'' => ''0'',\n)', '', '-99', '-99', 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 4, 0),
(".$parentid.", 'style', '颜色和字型', '', '', 0, 0, '', '', 'style', '', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 0),
(".$parentid.", 'keywords', '关键字', '', '', 0, 30, '', '', 'keyword', 'array (\n  ''size'' => ''30'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 6, 0),
(".$parentid.", 'thumb', '缩略图', '', '', 0, 100, '', '', 'image', 'array (\n  ''size'' => ''50'',\n  ''defaultvalue'' => '''',\n  ''upload_maxsize'' => ''1024'',\n  ''upload_allowext'' => ''gif|jpg|jpeg|png|bmp'',\n  ''isselectimage'' => ''0'',\n  ''isthumb'' => ''1'',\n  ''thumb_width'' => ''300'',\n  ''thumb_height'' => ''300'',\n  ''iswatermark'' => ''1'',\n  ''watermark_img'' => ''images/watermark.gif'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 7, 0),
(".$parentid.", 'content', '内容', '', '', 0, 0, '', '', 'editor', 'array (\n  ''toolbar'' => ''standard'',\n  ''width'' => ''100%'',\n  ''height'' => ''300'',\n  ''defaultvalue'' => '''',\n  ''storage'' => ''database'',\n  ''enablekeylink'' => ''0'',\n  ''replacenum'' => ''1'',\n  ''enablesaveimage'' => ''1'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 10, 0),
(".$parentid.", 'elite', '推荐', '', '', 0, 255, '', '', 'box', 'array (\n  ''options'' => ''推荐|1\r\n不推荐|0'',\n  ''boxtype'' => ''radio'',\n  ''fieldtype'' => ''TINYINT'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => ''0'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 11, 0),
(".$parentid.", 'listorder', '排序', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 12, 0),
(".$parentid.", 'inputtime', '添加时间', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'updatetime', '更新时间', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 21, 0),
(".$parentid.", 'status', '状态', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => ''99'',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 22, 0),
(".$parentid.", 'userid', '发布人', '', '', 0, 0, '', '', 'userid', '', '', '-99', '-99', 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 23, 0);");
$model->cache_field($parentid);

$db->query("INSERT INTO `".DB_PRE."model` (`name`, `description`, `tablename`, `itemname`, `itemunit`, `workflowid`, `template_category`, `template_list`, `template_show`, `template_print`, `ishtml`, `category_urlruleid`, `show_urlruleid`, `enablesearch`, `ischeck`, `isrelated`, `disabled`, `modeltype`) VALUES('产品', '', 'product', '产品', '篇', 1, '', '', '', '', 1, 1, 7, 1, 1, 1, 0, 9)");
$parentid = $db->insert_id();
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES
(".$parentid.", 'id', 'ID', '', '', 0, 0, '', '', 'number', '', '', '', '', 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0),
(".$parentid.", 'title', '产品名称', '', 'inputtitle', 3, 80, '', '', 'text', 'array (\n  ''size'' => ''80'',\n  ''defaultvalue'' => '''',\n  ''ispassword'' => ''0'',\n)', '', '-99', '-99', 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 2, 0),
(".$parentid.", 'catid', '所属分类', '', '', 0, 6, '', '', 'catid', 'array (\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 3, 0),
(".$parentid.", 'standard', '产品型号', '', '', 0, 50, '', '', 'text', 'array (\n  ''size'' => ''50'',\n  ''defaultvalue'' => '''',\n  ''ispassword'' => ''0'',\n)', '', '-99', '-99', 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'listorder', '排序', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'style', '颜色和字型', '', '', 0, 0, '', '', 'style', '', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 20, 0),
(".$parentid.", 'keywords', '关键字', '', '', 0, 30, '', '', 'keyword', 'array (\n  ''size'' => ''30'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'thumb', '缩略图', '', '', 0, 100, '', '', 'image', 'array (\n  ''size'' => ''50'',\n  ''defaultvalue'' => '''',\n  ''upload_maxsize'' => ''1024'',\n  ''upload_allowext'' => ''gif|jpg|jpeg|png|bmp'',\n  ''isselectimage'' => ''0'',\n  ''isthumb'' => ''1'',\n  ''thumb_width'' => ''800'',\n  ''thumb_height'' => ''600'',\n  ''iswatermark'' => ''1'',\n  ''watermark_img'' => ''images/watermark.gif'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'content', '详细说明', '', '', 0, 0, '', '', 'editor', 'array (\n  ''toolbar'' => ''standard'',\n  ''width'' => ''100%'',\n  ''height'' => ''300'',\n  ''defaultvalue'' => '''',\n  ''storage'' => ''database'',\n  ''enablekeylink'' => ''1'',\n  ''replacenum'' => ''1'',\n  ''enablesaveimage'' => ''1'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'userid', '发布人', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''0'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 22, 0),
(".$parentid.", 'price', '产品价格', '单位（元）', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''0'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''2'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 23, 0),
(".$parentid.", 'quantifier', '计量单位', '', '', 0, 6, '', '', 'box', 'array (\n  ''options'' => ''把|把\r\n包|包\r\n本|本\r\n部|部\r\n打|打\r\n袋|袋\r\n单|单\r\n刀|刀\r\n吊|吊\r\n顶|顶\r\n对|对\r\n吨|吨\r\n幅|幅\r\n个|个\r\n根|根\r\n公斤|公斤\r\n公升|公升\r\n罐|罐\r\n毫米|毫米\r\n毫升|毫升\r\n盒|盒\r\n架|架\r\n件|件\r\n节|节\r\n具|具\r\n卷|卷\r\n卡|卡\r\n棵|棵\r\n颗|颗\r\n克|克\r\n块|块\r\n款|款\r\n厘米|厘米\r\n立方|立方\r\n立方根|立方根\r\n粒|粒\r\n辆|辆\r\n码|码\r\n枚|枚\r\n米|米\r\n面|面\r\n盆|盆\r\n片|片\r\n票|票\r\n平方厘米|平方厘米\r\n平方米|平方米\r\n平方英尺|平方英尺\r\n瓶|瓶\r\n千克|千克\r\n升|升\r\n束|束\r\n双|双\r\n台|台\r\n套|套\r\n条|条\r\n桶|桶\r\n头|头\r\n箱|箱\r\n英寸|英寸\r\n盏|盏\r\n张|张\r\n支|支\r\n只|只\r\n株|株\r\n组|组\r\n尊|尊\r\n座|座'',\n  ''boxtype'' => ''select'',\n  ''fieldtype'' => ''VARCHAR'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 24, 0),
(".$parentid.", 'elite', '推荐', '', '', 0, 1, '', '', 'box', 'array (\n  ''options'' => ''推荐|1\r\n不推荐|0'',\n  ''boxtype'' => ''radio'',\n  ''fieldtype'' => ''TINYINT'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => ''0'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 25, 0),
(".$parentid.", 'status', '状态', '', '', 0, 2, '', '', 'box', 'array (\n  ''options'' => '''',\n  ''boxtype'' => ''radio'',\n  ''fieldtype'' => ''CHAR'',\n  ''cols'' => '''',\n  ''width'' => '''',\n  ''size'' => '''',\n  ''defaultvalue'' => ''0'',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 26, 0),
(".$parentid.", 'inputtime', '添加时间', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 27, 0),
(".$parentid.", 'updatetime', '更新时间', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 28, 0);");
$model->cache_field($parentid);

$db->query("INSERT INTO `".DB_PRE."model` (`name`, `description`, `tablename`, `itemname`, `itemunit`, `workflowid`, `template_category`, `template_list`, `template_show`, `template_print`, `ishtml`, `category_urlruleid`, `show_urlruleid`, `enablesearch`, `ischeck`, `isrelated`, `disabled`, `modeltype`) VALUES('商机', '', 'buy', '商机', '篇', 1, '', '', '', '', 1, 1, 7, 1, 1, 1, 0, 9)");
$parentid = $db->insert_id();
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES
(".$parentid.", 'id', 'ID', '', '', 0, 0, '', '', 'number', '', '', '', '', 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0),
(".$parentid.", 'tid', '商机类型', '', '', 0, 1, '', '', 'box', 'array (\n  ''options'' => ''供应|1\r\n求购|2\r\n二手|3\r\n促销|4'',\n  ''boxtype'' => ''radio'',\n  ''fieldtype'' => ''TINYINT'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => ''1'',\n)', 'onclick=\"buy_tid(this.value)\"', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0),
(".$parentid.", 'title', '产品名称', '', 'inputtitle', 3, 80, '', '', 'text', 'array (\n  ''size'' => ''80'',\n  ''defaultvalue'' => '''',\n  ''ispassword'' => ''0'',\n)', '', '-99', '-99', 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0),
(".$parentid.", 'catid', '所属分类', '', '', 0, 6, '', '', 'catid', 'array (\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 0),
(".$parentid.", 'standard', '产品型号', '', '', 0, 50, '', '', 'text', 'array (\n  ''size'' => ''50'',\n  ''defaultvalue'' => '''',\n  ''ispassword'' => ''0'',\n)', '', '-99', '-99', 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'listorder', '排序', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'style', '颜色和字型', '', '', 0, 0, '', '', 'style', '', '', '2,3,4,5,6,7,8', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'keywords', '关键字', '', '', 0, 30, '', '', 'keyword', 'array (\n  ''size'' => ''30'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'thumb', '缩略图', '', '', 0, 100, '', '', 'image', 'array (\n  ''size'' => ''50'',\n  ''defaultvalue'' => '''',\n  ''upload_maxsize'' => ''1024'',\n  ''upload_allowext'' => ''gif|jpg|jpeg|png|bmp'',\n  ''isselectimage'' => ''0'',\n  ''isthumb'' => ''1'',\n  ''thumb_width'' => ''800'',\n  ''thumb_height'' => ''600'',\n  ''iswatermark'' => ''1'',\n  ''watermark_img'' => ''images/watermark.gif'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'content', '详细说明', '', '', 0, 0, '', '', 'editor', 'array (\n  ''toolbar'' => ''standard'',\n  ''width'' => ''100%'',\n  ''height'' => ''300'',\n  ''defaultvalue'' => '''',\n  ''storage'' => ''database'',\n  ''enablekeylink'' => ''1'',\n  ''replacenum'' => ''1'',\n  ''enablesaveimage'' => ''1'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'userid', '发布人', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''0'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'price', '产品价格', '单位（元）', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''0'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''2'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'quantifier', '计量单位', '', '', 0, 6, '', '', 'box', 'array (\n  ''options'' => ''把|把\r\n包|包\r\n本|本\r\n部|部\r\n打|打\r\n袋|袋\r\n单|单\r\n刀|刀\r\n吊|吊\r\n顶|顶\r\n对|对\r\n吨|吨\r\n幅|幅\r\n个|个\r\n根|根\r\n公斤|公斤\r\n公升|公升\r\n罐|罐\r\n毫米|毫米\r\n毫升|毫升\r\n盒|盒\r\n架|架\r\n件|件\r\n节|节\r\n具|具\r\n卷|卷\r\n卡|卡\r\n棵|棵\r\n颗|颗\r\n克|克\r\n块|块\r\n款|款\r\n厘米|厘米\r\n立方|立方\r\n立方根|立方根\r\n粒|粒\r\n辆|辆\r\n码|码\r\n枚|枚\r\n米|米\r\n面|面\r\n盆|盆\r\n片|片\r\n票|票\r\n平方厘米|平方厘米\r\n平方米|平方米\r\n平方英尺|平方英尺\r\n瓶|瓶\r\n千克|千克\r\n升|升\r\n束|束\r\n双|双\r\n台|台\r\n套|套\r\n条|条\r\n桶|桶\r\n头|头\r\n箱|箱\r\n英寸|英寸\r\n盏|盏\r\n张|张\r\n支|支\r\n只|只\r\n株|株\r\n组|组\r\n尊|尊\r\n座|座'',\n  ''boxtype'' => ''select'',\n  ''fieldtype'' => ''CHAR'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 21, 0),
(".$parentid.", 'period', '信息有效期', '', '', 0, 3, '', '', 'box', 'array (\n  ''options'' => ''10天|10\r\n20天|20\r\n1个月|30\r\n3个月|90\r\n6个月|180'',\n  ''boxtype'' => ''radio'',\n  ''fieldtype'' => ''TINYINT'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => ''180'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 24, 0),
(".$parentid.", 'elite', '推荐', '', '', 0, 255, '', '', 'box', 'array (\n  ''options'' => ''推荐|1\r\n不推荐|0'',\n  ''boxtype'' => ''radio'',\n  ''fieldtype'' => ''TINYINT'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => ''0'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 26, 0),
(".$parentid.", 'status', '状态', '', '', 0, 0, '', '', 'box', '', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 27, 0),
(".$parentid.", 'inputtime', '添加时间', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 30, 0),
(".$parentid.", 'updatetime', '更新时间', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 31, 0);");
$model->cache_field($parentid);

$db->query("INSERT INTO `".DB_PRE."model` (`name`, `description`, `tablename`, `itemname`, `itemunit`, `workflowid`, `template_category`, `template_list`, `template_show`, `template_print`, `ishtml`, `category_urlruleid`, `show_urlruleid`, `enablesearch`, `ischeck`, `isrelated`, `disabled`, `modeltype`) VALUES('企业招聘', '', 'job', '名', '篇', 1, '', '', '', '', 1, 1, 7, 1, 1, 1, 0, 9)");
$parentid = $db->insert_id();
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES
(".$parentid.", 'station', '岗位', '', '', 1, 0, '', '', 'typeid', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0),
(".$parentid.", 'title', '职位名称', '', '', 3, 80, '', '', 'text', 'array (\n  ''size'' => ''50'',\n  ''defaultvalue'' => '''',\n  ''ispassword'' => ''0'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0),
(".$parentid.", 'workplace', '工作地点', '', '', 0, 10, '', '', 'box', 'array (\n  ''options'' => ''北京|北京\r\n上海|上海\r\n杭州|杭州\r\n广州|广州\r\n深圳|深圳\r\n南京|南京\r\n武汉|武汉\r\n天津|天津\r\n成都|成都\r\n哈尔滨|哈尔滨\r\n重庆|重庆\r\n宁波|宁波\r\n无锡|无锡\r\n济南|济南\r\n苏州|苏州\r\n温州|温州\r\n青岛|青岛\r\n沈阳|沈阳\r\n福州|福州\r\n西安|西安\r\n长沙|长沙\r\n合肥|合肥\r\n南宁|南宁\r\n南昌|南昌\r\n郑州|郑州\r\n厦门|厦门\r\n大连|大连\r\n常州|常州\r\n石家庄|石家庄\r\n东莞|东莞\r\n安徽|安徽\r\n福建|福建\r\n甘肃|甘肃\r\n广东|广东\r\n广西|广西\r\n贵州|贵州\r\n海南|海南\r\n河北|河北\r\n黑龙江|黑龙江\r\n河南|河南\r\n湖北|湖北\r\n湖南|湖南\r\n江苏|江苏\r\n江西|江西\r\n吉林|吉林\r\n辽宁|辽宁\r\n内蒙古|内蒙古\r\n宁夏|宁夏\r\n青海|青海\r\n山东|山东\r\n山西|山西\r\n陕西|陕西\r\n四川|四川\r\n新疆|新疆\r\n西藏|西藏\r\n云南|云南\r\n浙江|浙江\r\n江苏|江苏\r\n浙江|浙江\r\n上海|上海\r\n广州|广州\r\n深圳|深圳\r\n中山|中山\r\n珠海|珠海\r\n佛山|佛山\r\n东莞|东莞\r\n惠州|惠州\r\n香港|香港\r\n澳门|澳门\r\n台湾|台湾\r\n海外|海外\r\n其它|其它'',\n  ''boxtype'' => ''select'',\n  ''fieldtype'' => ''VARCHAR'',\n  ''cols'' => '''',\n  ''width'' => '''',\n  ''size'' => '''',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0),
(".$parentid.", 'status', '状态', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => ''99'',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(".$parentid.", 'style', '颜色和字型', '', '', 0, 0, '', '', 'style', '', '', '2,3,4,5,6,7,8', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0),
(".$parentid.", 'employ', '招聘人数', '', '', 0, 5, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => ''1000'',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 0),
(".$parentid.", 'experience', '工作经验', '', '', 0, 6, '', '', 'box', 'array (\n  ''options'' => ''不限|不限\r\n1年|1年\r\n2年|2年\r\n3年|3年\r\n4年|4年\r\n5年|5年\r\n6年以上|6年以上'',\n  ''boxtype'' => ''select'',\n  ''fieldtype'' => ''VARCHAR'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => ''1年'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 0),
(".$parentid.", 'worktype', '工作性质', '', '', 0, 6, '', '', 'box', 'array (\n  ''options'' => ''不限|不限\r\n全职|全职\r\n兼职|兼职'',\n  ''boxtype'' => ''select'',\n  ''fieldtype'' => ''VARCHAR'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => ''全职'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 4, 0),
(".$parentid.", 'sex', '性别要求', '', '', 0, 10, '', '', 'box', 'array (\n  ''options'' => ''不限|不限\r\n男|男\r\n女|女'',\n  ''boxtype'' => ''select'',\n  ''fieldtype'' => ''VARCHAR'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => ''不限'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 0),
(".$parentid.", 'degree', '学历要求', '', '', 0, 6, '', '', 'box', 'array (\n  ''options'' => ''不限|不限\r\n高中|高中\r\n大专|大专\r\n本科|本科\r\n研究生|研究生\r\n硕士|硕士\r\n博士|博士'',\n  ''boxtype'' => ''select'',\n  ''fieldtype'' => ''VARCHAR'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => ''大专'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 6, 0),
(".$parentid.", 'pay', '月薪', '单位：元', '', 0, 8, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => ''面议'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 7, 0),
(".$parentid.", 'period', '有效期', '', '', 0, 3, '', '', 'box', 'array (\n  ''options'' => ''三天|3\r\n一周|7\r\n两周|14\r\n三周|21\r\n一个月|30\r\n两个月|60\r\n三个月|90\r\n不限制|0'',\n  ''boxtype'' => ''select'',\n  ''fieldtype'' => ''TINYINT'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => ''7'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 8, 0),
(".$parentid.", 'listorder', '排序', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'content', '职位描述', '', '', 0, 0, '', '', 'editor', 'array (\n  ''toolbar'' => ''basic'',\n  ''width'' => ''100%'',\n  ''height'' => ''300'',\n  ''defaultvalue'' => '''',\n  ''storage'' => ''database'',\n  ''enablekeylink'' => ''1'',\n  ''replacenum'' => ''1'',\n  ''enablesaveimage'' => ''1'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 20, 0),
(".$parentid.", 'elite', '推荐', '', '', 0, 1, '', '', 'box', 'array (\n  ''options'' => ''推荐|1\r\n不推荐|0'',\n  ''boxtype'' => ''radio'',\n  ''fieldtype'' => ''TINYINT'',\n  ''cols'' => ''5'',\n  ''width'' => ''80'',\n  ''size'' => ''1'',\n  ''defaultvalue'' => ''0'',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 21, 0),
(".$parentid.", 'userid', '发布人', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''0'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 22, 0),
(".$parentid.", 'inputtime', '添加时间', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 30, 0),
(".$parentid.", 'updatetime', '更新时间', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 31, 0);");
$model->cache_field($parentid);

require_once PHPCMS_ROOT.'member/admin/include/model_member.class.php';
$model = new member_model();
$model->cache();
require_once PHPCMS_ROOT.'member/admin/include/model_member_field.class.php';

$member_field = new member_model_field($model_companyid);
$member_field->cache();

$db->query("INSERT INTO `".DB_PRE."block` (`pageid`, `blockno`, `name`, `isarray`, `rows`, `data`, `listorder`, `disabled`) VALUES('ypindex', 1, '首页大图片广告', 1, 1, 'array (\n  0 => \n  array (\n    ''title'' => ''大图片广告位'',\n    ''url'' => ''#'',\n    ''thumb'' => ''yp/images/temp_1.jpg'',\n    ''date'' => ''2009-05-10'',\n    ''description'' => ''大图片广告'',\n  ),\n)', 2, 0)");
$parentid = $db->insert_id();
copy(PHPCMS_ROOT.'yp/install/block/b1.html', PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html');
@chmod(PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html', 0777);
$db->query("INSERT INTO `".DB_PRE."block` (`pageid`, `blockno`, `name`, `isarray`, `rows`, `data`, `listorder`, `disabled`) VALUES('ypindex', 2, '黄页行业分类下广告', 1, 1, 'array (\n  0 => \n  array (\n    ''title'' => ''PHPCMS 夏季百人促销'',\n    ''url'' => ''http://www.phpcms.cn/cx/?hy'',\n    ''thumb'' => ''uploadfile/2009/0510/20090427104117692.gif'',\n    ''date'' => ''2009-04-21'',\n    ''description'' => '''',\n  ),\n)', 2, 0)");
$parentid = $db->insert_id();
copy(PHPCMS_ROOT.'yp/install/block/b2.html', PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html');
@chmod(PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html', 0777);

$db->query("INSERT INTO `".DB_PRE."block` (`pageid`, `blockno`, `name`, `isarray`, `rows`, `data`, `listorder`, `disabled`) VALUES('ypindex', 4, '黄页商机下广告', 1, 1, 'array (\n  0 => \n  array (\n    ''title'' => ''phpcms 官方论坛'',\n    ''url'' => ''http://bbs.phpcms.cn'',\n    ''thumb'' => ''uploadfile/2009/0510/20090427104832812.jpg'',\n    ''date'' => ''2009-05-10'',\n    ''description'' => '''',\n  ),\n)', 2, 0)");
$parentid = $db->insert_id();
copy(PHPCMS_ROOT.'yp/install/block/b3.html', PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html');
@chmod(PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html', 0777);

$db->query("INSERT INTO `".DB_PRE."block` (`pageid`, `blockno`, `name`, `isarray`, `rows`, `data`, `listorder`, `disabled`) VALUES('ypindex', 3, '黄页商机内部广告', 1, 3, 'array (\n  0 => \n  array (\n    ''title'' => ''PHPCMS 携手主机网 真情大回馈'',\n    ''url'' => ''http://bbs.phpcms.cn/thread-97819-1-1.html'',\n    ''thumb'' => ''uploadfile/2009/0510/20090422105011369.jpg'',\n    ''date'' => ''2009-05-10'',\n    ''description'' => '''',\n  ),\n  1 => \n  array (\n    ''title'' => ''帮助中心'',\n    ''url'' => ''http://help.phpcms.cn'',\n    ''thumb'' => ''uploadfile/2009/0510/20090422105016719.jpg'',\n    ''date'' => ''2009-05-10'',\n    ''description'' => '''',\n  ),\n  2 => \n  array (\n    ''title'' => ''论坛 PC币 大放送'',\n    ''url'' => ''http://bbs.phpcms.cn/thread-95891-1-1.html'',\n    ''thumb'' => ''uploadfile/2009/0510/20090422105021840.jpg'',\n    ''date'' => ''2009-05-10'',\n    ''description'' => '''',\n  ),\n)', 2, 0)");
$parentid = $db->insert_id();
copy(PHPCMS_ROOT.'yp/install/block/b4.html', PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html');
@chmod(PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html', 0777);

$db->query("INSERT INTO `".DB_PRE."block` (`pageid`, `blockno`, `name`, `isarray`, `rows`, `data`, `listorder`, `disabled`) VALUES('ypindex', 5, '黄页首页人才内广告', 1, 4, 'array (\n  0 => \n  array (\n    ''title'' => ''虚位以待'',\n    ''url'' => ''#'',\n    ''thumb'' => ''uploadfile/2009/0510/20090422105035654.jpg'',\n    ''date'' => ''2009-05-10'',\n    ''description'' => '''',\n  ),\n  1 => \n  array (\n    ''title'' => ''虚位以待'',\n    ''url'' => ''#'',\n    ''thumb'' => ''uploadfile/2009/0510/20090422105035654.jpg'',\n    ''date'' => ''2009-05-10'',\n    ''description'' => '''',\n  ),\n  2 => \n  array (\n    ''title'' => ''虚位以待'',\n    ''url'' => ''#'',\n    ''thumb'' => ''uploadfile/2009/0510/20090422105035654.jpg'',\n    ''date'' => ''2009-05-10'',\n    ''description'' => '''',\n  ),\n  3 => \n  array (\n    ''title'' => ''虚位以待'',\n    ''url'' => ''#'',\n    ''thumb'' => ''uploadfile/2009/0510/20090422105035654.jpg'',\n    ''date'' => ''2009-05-10'',\n    ''description'' => '''',\n  ),\n)', 2, 0)");
$parentid = $db->insert_id();
copy(PHPCMS_ROOT.'yp/install/block/b5.html', PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html');
@chmod(PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html', 0777);

$db->query("INSERT INTO `".DB_PRE."block` (`pageid`, `blockno`, `name`, `isarray`, `rows`, `data`, `listorder`, `disabled`) VALUES('yphead', 1, '黄页关键字', 1, 8, 'array (\n  0 => \n  array (\n    ''title'' => ''办公桌'',\n    ''url'' => ''yp/product.php?q=%BC%D2%BE%DF&action=searchlist'',\n    ''thumb'' => '''',\n    ''date'' => '''',\n    ''description'' => '''',\n  ),\n  1 => \n  array (\n    ''title'' => ''家具'',\n    ''url'' => ''yp/product.php?q=%BC%D2%BE%DF&action=searchlist'',\n    ''thumb'' => '''',\n    ''date'' => '''',\n    ''description'' => '''',\n  ),\n  2 => \n  array (\n    ''title'' => ''保时捷'',\n    ''url'' => ''yp/product.php?q=%B1%A3%CA%B1%BD%DD&action=searchlist'',\n    ''thumb'' => '''',\n    ''date'' => '''',\n    ''description'' => '''',\n  ),\n  3 => \n  array (\n    ''title'' => ''红木'',\n    ''url'' => ''yp/product.php?q=%BA%EC%C4%BE&action=searchlist'',\n    ''thumb'' => '''',\n    ''date'' => '''',\n    ''description'' => '''',\n  ),\n  4 => \n  array (\n    ''title'' => ''地垫'',\n    ''url'' => ''yp/product.php?q=%B5%D8%B5%E6&action=searchlist'',\n    ''thumb'' => '''',\n    ''date'' => '''',\n    ''description'' => '''',\n  ),\n  5 => \n  array (\n    ''title'' => ''雪尼尔'',\n    ''url'' => ''yp/product.php?q=%D1%A9%C4%E1%B6%FB&action=searchlist'',\n    ''thumb'' => '''',\n    ''date'' => '''',\n    ''description'' => '''',\n  ),\n)', 2, 0)");
$parentid = $db->insert_id();
copy(PHPCMS_ROOT.'yp/install/block/b6.html', PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html');
@chmod(PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html', 0777);

$db->query("INSERT INTO `".DB_PRE."block` (`pageid`, `blockno`, `name`, `isarray`, `rows`, `data`, `listorder`, `disabled`) VALUES('yphead', 2, '黄页头部广告条', 1, 1, 'array (\n  0 => \n  array (\n    ''title'' => ''PHPCMS企业黄页为您提供动力'',\n    ''url'' => ''#'',\n    ''thumb'' => ''uploadfile/2009/0510/20090429085859722.swf'',\n    ''date'' => ''2009-05-10'',\n    ''description'' => '''',\n  ),\n)', 2, 0)");
$parentid = $db->insert_id();
copy(PHPCMS_ROOT.'yp/install/block/b7.html', PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html');
@chmod(PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/block/'.$parentid.'.html', 0777);

copy(PHPCMS_ROOT.'yp/install/upload_field.html', PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/upload_field.html');
@chmod(PHPCMS_ROOT.'templates/'.TPL_NAME.'/phpcms/upload_field.html', 0777);
//更新碎片缓存
if(!is_object($block))
{
	require_once 'block.class.php';
	$block = new block();
}
$block->refresh();
?>